<div id="content-header">
    <?php
    $this->widget('bootstrap.widgets.TbBreadcrumbs', array(
        'links' => array('Phân quyền' => 'index', 'Danh sách'),
        'htmlOptions' => array('id' => 'breadcrumb')
    ));
    ?>
    <h1>Danh sách</h1>
</div>
<div class="widget-box">
    <div class="widget-content nopadding">
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
            <?php
            $form = $this->beginWidget('CActiveForm', array(
                'enableAjaxValidation' => TRUE,
                    ));
            ?>
            <div class="button-bottom">
                <?php
                echo CHtml::link('Thêm mới', array('authitem/create'));
                ?>

            </div>
            <?php
            $this->widget('bootstrap.widgets.TbGridView', array(
                'id' => 'authitem-grid',
                'dataProvider' => $model->search(),
                'filter' => $model,
                'selectableRows' => 2,
                'columns' => array(
                    array(
                        'id' => 'autoId',
                        'class' => 'zii.widgets.grid.CCheckBoxColumn',
                        'selectableRows' => '50',
                    ),
                    array(
                        'header' => '#',
                        'class' => 'ext.CounterColumn',
                    ),
                    'name',
                    array(
                        'name' => 'type',
                        'value' => 'CHtml::dropDownlist($data->name,$data->name,array(Authitem::select()),array(
                                    \'class\'=>\'status\',
                                    \'options\'=>array($data->type=>array(\'selected\'=>\'selected\')),
                                    \'ajax\'=>array(
                                        \'type\' => \'POST\',
                                        \'url\'=>Yii::app()->createUrl(\'authitem/\'),                        
                                        \'data\'=>array(\'type\'=>\'js:this.value\',\'id\'=>$data->name),
        )
        ));',
                        'type' => 'raw',
                        'filter' => CHtml::activeDropDownList($model, 'type', Authitem::select()),
                    ),
                    'description',
                    'bizrule',
                    'data',
                ),
            ));
            ?>
            <script>
                function reloadGrid(data) {
                    $.fn.yiiGridView.update('authitem-grid');
                }
            </script>
            <?php $this->endWidget(); ?>
        </div>
    </div>
</div>